# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This package implements the various component validators for PINs NSF tests.
#
# Note: These are dummy validators added as example of ComponentValidators implementation.
# Component owners need to have their own implementations and register to be used by the NSF Upgrade
# tests.

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "p4rt_validator",
    testonly = True,
    srcs = ["p4rt_validator.cc"],
    hdrs = ["p4rt_validator.h"],
    deps = [
        "//gutil/gutil:status",
        "//lib/gnmi:gnmi_helper",
        "//tests/integration/system/nsf:util",
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
    ],
)

cc_library(
    name = "sai_validator",
    testonly = True,
    hdrs = ["sai_validator.h"],
    deps = [
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
    ],
)

cc_library(
    name = "swss_validator",
    testonly = True,
    srcs = ["swss_validator.cc"],
    hdrs = ["swss_validator.h"],
    deps = [
        "//tests/integration/system/nsf:util",
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
    ],
)

cc_library(
    name = "syncd_validator",
    testonly = True,
    srcs = ["syncd_validator.cc"],
    hdrs = ["syncd_validator.h"],
    deps = [
        "//tests/integration/system/nsf:util",
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "//thinkit:switch",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
    ],
)

cc_library(
    name = "telemetry_validator",
    testonly = True,
    srcs = ["telemetry_validator.cc"],
    hdrs = ["telemetry_validator.h"],
    deps = [
        "//tests/integration/system/nsf:util",
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "//thinkit:switch",
        "@com_github_google_glog//:glog",
        "@com_github_grpc_grpc//:grpc++",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
    ],
)

cc_library(
    name = "component_perf_validator",
    testonly = True,
    srcs = ["component_perf_validator.cc"],
    hdrs = ["component_perf_validator.h"],
    deps = [
        "//tests/integration/system/nsf:util",
        "//tests/integration/system/nsf/interfaces:component_validator",
        "//tests/integration/system/nsf/interfaces:testbed",
        "//thinkit:ssh_client",
        "//thinkit:switch",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
    ],
)
